add a get_indices_with_depth method to GtkTreePath with proper GI array annotations
authorJohn (J5) Palmieri <johnp@redhat.com>
Tue, 27 Apr 2010 21:12:41 +0000 (17:12 -0400)
committerJohn (J5) Palmieri <johnp@redhat.com>
Mon, 3 May 2010 16:47:38 +0000 (12:47 -0400)
* get_indices does not return a length so we can not annotate it to return an
  array in bindings that use GObject Introspection
* this method is the same as get_indices except it takes an int * as the depth
  parameter which we can then use in the array annotation
* in C this function returns an integer pointer array and updates depth to the
  number of integers in the array
* in a GI binding this returns the native array type for the bound language
  (e.g. in PyGI this returns a list of integers)

docs/reference/gtk/gtk-sections.txt
docs/reference/gtk/tmpl/gtktreemodel.sgml
gtk/gtk.symbols
gtk/gtktreemodel.c
gtk/gtktreemodel.h

index b5235901f7b21b2851d5d3ecb744533b2d9ca064..684b30db998fcc39e3821ef06b9367d5eaf75b92 100644 (file)
@@ -4675,6 +4675,7 @@ gtk_tree_path_append_index
 gtk_tree_path_prepend_index
 gtk_tree_path_get_depth
 gtk_tree_path_get_indices
+gtk_tree_path_get_indices_with_depth
 gtk_tree_path_free
 gtk_tree_path_copy
 gtk_tree_path_compare
index e16a9fdb79b493d60669f20297652f82fabf864c..d635009210984aeea1efaccb5022781b2843bfaf 100644 (file)
@@ -412,6 +412,16 @@ compatibility reasons.
 @Returns: 
 
 
+<!-- ##### FUNCTION gtk_tree_path_get_indices_with_depth ##### -->
+<para>
+
+</para>
+
+@path:
+@depth: 
+@Returns: 
+
+
 <!-- ##### FUNCTION gtk_tree_path_free ##### -->
 <para>
 
index ccda44841f6e71cb4fa82fb4f5329670d50d5111..a285bfde05d6d07c68af587b44856668d88d9fe7 100644 (file)
@@ -4671,6 +4671,7 @@ gtk_tree_path_down
 gtk_tree_path_free
 gtk_tree_path_get_depth
 gtk_tree_path_get_indices
+gtk_tree_path_get_indices_with_depth
 gtk_tree_path_get_type G_GNUC_CONST
 gtk_tree_path_is_ancestor
 gtk_tree_path_is_descendant
index 5bdce35479ce49504ebdc923f85bed8dff64c9e7..bf45a31f9701e91a59856d1c6faa0a69d869872c 100644 (file)
@@ -622,6 +622,31 @@ gtk_tree_path_get_indices (GtkTreePath *path)
   return path->indices;
 }
 
+/**
+ * gtk_tree_path_get_indices_with_depth:
+ * @path: A #GtkTreePath.
+ * @depth: Number of elements returned in the integer array
+ *
+ * Returns the current indices of @path.
+ * This is an array of integers, each representing a node in a tree.
+ * It also returns the number of elements in the array.
+ * The array should not be freed.
+ *
+ * Return value: (array length=depth): The current indices, or %NULL.
+ *
+ * Since: 3.0
+ **/
+gint *
+gtk_tree_path_get_indices_with_depth (GtkTreePath *path, gint *depth)
+{
+  g_return_val_if_fail (path != NULL, NULL);
+
+  if (depth)
+    *depth = path->depth;
+
+  return path->indices;
+}
+
 /**
  * gtk_tree_path_free:
  * @path: A #GtkTreePath.
index b48e87b642cc1ccc29be5dbcbb9b466635c616d8..ba0fe4ef3e34a2422e050680e0b28305995be8bb 100644 (file)
@@ -134,6 +134,10 @@ void         gtk_tree_path_prepend_index    (GtkTreePath       *path,
                                             gint               index_);
 gint         gtk_tree_path_get_depth        (GtkTreePath       *path);
 gint        *gtk_tree_path_get_indices      (GtkTreePath       *path);
+
+gint        *gtk_tree_path_get_indices_with_depth (GtkTreePath *path,
+                                                  gint        *depth);
+
 void         gtk_tree_path_free             (GtkTreePath       *path);
 GtkTreePath *gtk_tree_path_copy             (const GtkTreePath *path);
 GType        gtk_tree_path_get_type         (void) G_GNUC_CONST;